import React from "react";
interface User {
  name: string;
  id: number;
}
interface ActionPanelProps {
  add: (item: User) => void;
  clear: () => void;
  removeItem: (index: number) => void;
}
export const ActionPanel = ({ add, clear, removeItem }: ActionPanelProps) => {
  const addJack = () => {
    console.log(1111111);
    add({
      id: Date.now(),
      name: "djw",
    });
    // add("jack")
  };
  return (
    <ul className="myul">
      <li onClick={addJack}>add Jack</li>
      <li onClick={() => removeItem(0)}>remove 0</li>
      <li onClick={clear}>clear</li>
    </ul>
  );
};
